package com.benben.springSecurity.weiwei;

public class MissingNumber {
    public int missingNum(int[] arr){
        int len = arr.length;
        int cha = Math.abs(arr[len-1]-arr[0])/len;
        int result =0;
        for(int i=0;i<len-1;i++){
            if(Math.abs(arr[i+1]-arr[i]) != cha){
                result = (arr[i]+arr[i+1])/2;
            }
        }
        return result;
    }
}
